export default {
	data() {
		return {
			modal: {
				content: "",
			},
		}
	},
	methods: {
		showModal(props) {
			this.modal.content = props.content || ""
			this.$refs["app-modal"].show({
				title: props.title || "提示",
				showCancel: props.showCancel,
				confirmText: props.confirmText,
				cancelText: props.cancelText,
				maskClose: props.maskClose,
				confirm: (...confirmArgs) => {
					if (props.confirm) {
						props.confirm(...confirmArgs)
					} else {
						next()
					}
				},
				cancel: () => {
					props.cancel && props.cancel()
					if (this.$refs["app-modal"].animateVisible) {
						this.$refs["app-modal"].close()
					}
				},
			})
		},
	},
}
